<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="../include/tag.jsp" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>礼包项目列表</title>
    <link rel="stylesheet" href="${ctx}/css/common/list.css">
    <link rel="stylesheet" href="${ctx}/css/common/table.css">
    <%@include file="../include/commonFile.jsp" %>
</head>
<body>
<!--头部-->
<%@include file="../include/header.jsp" %>
<div class="index-outside">
    <%@include file="../include/sidebar.jsp" %>
    <!--内容-->
    <section>
        <div class="section-main">
            <form class="layui-form" action="${ctx}/gift/gift/giftTargetList.do?giftId=${gift.id}" id="myForm" method="post">
                <input type="hidden" name="pageNo" id="pageNo"/>
                <div class="f-search-bar">
                    <div class="search-container">
                        <ul class="search-form-content">
                            <li class="form-item-inline"><label class="search-form-lable">项目名称</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="targetName" class="layui-input" value="${giftTarget.targetName}">
                                </div>
                            </li>
                            <li class="form-item-inline">
                                <div class="sub-btns">
                                    <a class="layui-btn layui-btn-danger submitBtn" href="javascript:submitFunction('#myForm')">查询</a>
                                    <a class="layui-btn layui-btn-normal" href="javascript:resetFunction('#myForm')">重置</a>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>
            </form>
            <div class="list-content">
                <div class="cl">
                    <table class="layui-table">
                        <colgroup>
                            <col>
                            <c:if test="${gift.model != 3}">
                                <col>
                            </c:if>
                            <col>
                        </colgroup>
                        <thead>
                        <tr>
                            <th>众筹项目名称</th>
                            <c:if test="${gift.model != 3}">
                                <th>领取总数</th>
                            </c:if>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach var="giftt" items="${targetList}">
                            <tr>
                                <td class="ellipsis-1">${giftt.targetName}</td>
                                <c:if test="${gift.model != 3}">
                                    <td>${giftt.salesNum}</td>
                                </c:if>
                                <td class="opts-btns tb-opts">
                                    <div class="comm-opts">
                                        <a class="red" href="javascript:txz.deleteObject('确定要移除项目和礼包的关系吗？', '${ctx}/gift/gift/removeTarget.do?giftId=${giftt.giftId}&targetId=${giftt.targetId}', '该项目已经有领取信息，不能解除关系');">移除关系</a>
                                        <c:if test="${gift.model != 3}">
                                            <a href="${ctx}/gift/gift/giftOrderList.do?giftId=${giftt.giftId}&targetId=${giftt.targetId}">领取用户列表</a>
                                        </c:if>
                                    </div>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
            <div id="page_content" class="page-container"></div>
        </div><!--底部-->
        <%@include file="../include/footer.jsp" %>
    </section>
</div>

<script type="text/javascript" src="${ctx}/script/common/list.js"></script>
<script type="text/javascript" src="${ctx}/script/common/table_option.js"></script>
<script type="text/javascript">
    $(function () {
        // 加载分页
        loadPageNew({
            elem: 'page_content',
            totalCount: '${page.totalCount}',
            limit: '${page.limit}',
            page: '${page.page}'
        });
    });
</script>
<script type="text/javascript">
    txz.initHeader({
        nav:[{
            name: '礼包管理',
            href:'${ctx}/gift/gift/list.do'
        },{
            name: '${gift.name}',
            curr: true
        },{
            name: '项目列表',
            curr: true
        }],
        info:'<span class="f12">共<b id="totalCount">${page.totalCount}</b>条记录</span>',
        btns:[{
            type:'back'
        }]
    });
</script>
</body>
</html>